#ifndef CD3DCLASS_H
#define CD3DCLASS_H

class CD3DClass
{
	bool m_bVSyncEnabled;
	int m_nVideoCardMemory;
	char m_cVideoCardDescription[128];
	IDXGISwapChain* m_pSwapChain;
	ID3D11Device* m_pDevice;
	ID3D11DeviceContext* m_pDeviceContext;
	ID3D11RenderTargetView* m_pRenderTargetView;
	ID3D11Texture2D* m_pDepthStencilBuffer;
	ID3D11DepthStencilState* m_pDepthStencilState;
	ID3D11DepthStencilView* m_pDepthStencilView;
	ID3D11RasterizerState* m_pRasterState;
	D3DXMATRIX m_d3dProjectionMatrix;
	D3DXMATRIX m_d3dWorldMatrix;
	D3DXMATRIX m_d3dOrthographicMatrix;
	ID3D11DepthStencilState* m_pDepthDisabledStencilState;
	ID3D11BlendState* m_pAlphaEnableBlendingState;
	ID3D11BlendState* m_pAlphaDisableBlendingState;

public:
	CD3DClass(void);
	CD3DClass(const CD3DClass&);
	~CD3DClass(void);

	bool Initialize(int nScreenWidth, int nScreenHeight, bool bEnableVSync, HWND hWnd, bool bEnableFullScreen, float fScreenDepth, float fScreenNear);
	void ShutDown();

	void BeginScene(float fRed, float fGreen, float fBlue, float fAlpha);
	void EndScene();

	ID3D11Device* GetDevice();
	ID3D11DeviceContext* GetDeviceContext();

	void GetProjectionMatrix(D3DXMATRIX& d3dProjectionMatrix);
	void GetWorldMatrix(D3DMATRIX& d3dWorldMatrix);
	void GetOrthographicMatrix(D3DMATRIX& d3dOrthographicMatrix);

	void GetVideoCardInfo(char* cCardName, int& nMemory);

	void TurnZBufferOn();
	void TurnZBufferOff();

	void TurnOnAlphaBlending();
	void TurnOffAlphaBlending();
};

#endif